WT_DECLARE_WT_MEMBER(1,JavaScriptFunction,"validate",function(a){var b;b=a.options?a.options.item(a.selectedIndex)==null?"":a.options.item(a.selectedIndex).text:a.value;b=a.wtValidate.validate(b);this.setValidationState(a,b.valid,b.message,1)});
WT_DECLARE_WT_MEMBER(2,JavaScriptFunction,"setValidationState",function(a,b,h,e){var i=b==1&&(e&2)!=0;e=b!=1&&(e&1)!=0;var d=$(a);d.toggleClass("Wt-valid",i).toggleClass("Wt-invalid",e);var c,f,g;c=d.closest(".control-group");if(c.length>0){f="success";g="error"}else{c=d.closest(".form-group");if(c.length>0){f="has-success";g="has-error"}}if(c.length>0){if(d=c.find(".Wt-validation-message"))b?d.text(a.defaultTT):d.text(h);c.toggleClass(f,i).toggleClass(g,e)}if(typeof a.defaultTT==="undefined")a.defaultTT=
a.getAttribute("title")||"";b?a.setAttribute("title",a.defaultTT):a.setAttribute("title",h)});
